<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserCommissionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_commissions', function (Blueprint $table) {
            $table->id()->comment('用户佣金记录表');
            $table->integer('user_id')->comment('用户id');
            $table->decimal('total_amount')->comment('总佣金金额');
            $table->decimal('account_amount')->comment('佣金金额');
            $table->decimal('withdrawal_amount')->comment('提现到账佣金');
            $table->string('remarks')->comment('备注');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_commissions');
    }
}
